#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QLabel>
#include <QSpinBox>
#include <QPixmap>

class QTreeWidgetItem;

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT
private :
    enum treeColumn {
        colItem,
        colItemType,
        colItemDate
    };

    enum treeItemType {
        itTopItem = 1001,
        itGroupItem,
        itImageItem
    };

    void changeItemCaption(QTreeWidgetItem* item);
    void displayImage(QTreeWidgetItem* item);

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void on_action_add_folder_triggered();

    void on_action_add_file_triggered();

    void on_action_delete_node_triggered();

    void on_tw_file_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);

    void on_action_traverse_node_triggered();

    void on_action_suitable_width_triggered();

    void on_action_suitable_height_triggered();

    void on_action_actual_size_triggered();

    void on_action_amplify_triggered();

    void on_action_reduce_triggered();

private :
    QLabel* lbl_file_name{nullptr};
    QLabel* lbl_node_text{nullptr};
    QSpinBox* spin_ratio{nullptr};
    QPixmap m_pixmap;
    float m_ratio;

private:
    Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
